
************************************************************
*  Regressions in Table 5a
************************************************************

clear
# delimit ;
version 11;
set matsize 1000;
capture log close;
set more 1;
log using table5a.log, replace;

************************************************************;
* Regressions using data by 1-year age group (columns 1-3);
************************************************************;

use data_1yr_stacked;

gen yob=1959-age;
gen time=yob-1915;

*  Proportion married;
*  Women age 18-44;
reg marrf sr10a lnpopm urbshf i.yob i.regno i.lgreg#i.yob, cluster(regno);
reg marrfu sr10u lnpopmu i.yob i.regno i.lgreg#i.yob, cluster(regno);
reg marrfr sr10r lnpopmr i.yob i.regno i.lgreg#i.yob, cluster(regno);

*  Men age 18-44;
reg marrm sr10a lnpopf urbshm i.yob i.regno i.lgreg#i.yob, cluster(regno);
reg marrmu sr10u lnpopfu i.yob i.regno i.lgreg#i.yob, cluster(regno);
reg marrmr sr10r lnpopfr i.yob i.regno i.lgreg#i.yob, cluster(regno);


*  Birth rate;
*  Women age 18-44;
reg brate sr10a lnpopm urbshf i.yob i.regno i.lgreg#i.yob, cluster(regno);
reg brateu sr10u lnpopmu i.yob i.regno i.lgreg#i.yob, cluster(regno);
reg brater sr10r lnpopmr i.yob i.regno i.lgreg#i.yob, cluster(regno);


************************************************************;
* Regressions using data by 5-year age group (columns 4-8);
************************************************************;

clear;
use data_5yr_stacked;

quietly tab regno, gen(reg);
quietly tab agegroup, gen(agegroup);

gen lgreg=0;
replace lgreg=1 if north==1;
replace lgreg=2 if norwest==1;
replace lgreg=3 if central==1;
replace lgreg=3 if regno==16;
replace lgreg=4 if cenchern==1;
replace lgreg=5 if volga==1;
replace lgreg=6 if povolzh==1;
replace lgreg=7 if ncauc==1;
replace lgreg=8 if urals==1;
replace lgreg=9 if esib==1;
replace lgreg=10 if wsib==1;
replace lgreg=11 if fareast==1;

gen time=0 if agegroup==1;
replace time=1 if agegroup==2;
replace time=2 if agegroup==3;
replace time=3 if agegroup==4;
replace time=4 if agegroup==5;
replace time=5 if agegroup==6;
replace time=6 if agegroup==7;

*  Married fertility rates;
*  Age 16-44;
reg asbrm sr10a lnpopm urbshf i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);
reg asbrmu sr10u lnpopmu i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);
reg asbrmr sr10r lnpopmr i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);

*  Unmarried fertility rates;
reg asbrnd sr10a lnpopm urbshf i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);
reg asbrndu sr10u lnpopmu i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);
reg asbrndr sr10r lnpopmr i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);

*  % Out-of-wedlock births;
*  Age 16-44;
reg nodad sr10a lnpopm urbshf i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);
reg nodadu sr10u lnpopmu i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);
reg nodadr sr10r lnpopmr i.agegroup i.regno i.lgreg#i.agegroup if agegroup !=7, cluster(regno);

*  Very large age gap at marriage (11+ years);
*  Women age 16-49;
reg vlargegap sr10a lnpopm urbshf i.agegroup i.regno i.lgreg#i.agegroup, cluster(regno);
reg vlargegapu sr10u lnpopmu i.agegroup i.regno i.lgreg#i.agegroup, cluster(regno);
reg vlargegapr sr10r lnpopmr i.agegroup i.regno i.lgreg#i.agegroup, cluster(regno);

clear;

*  Divorce regressions (diffeent age groups than previous regressions);
use data_5yr_stacked_div;

gen time=0 if agegroup==1;
replace time=1 if agegroup==2;
replace time=2 if agegroup==3;
replace time=3 if agegroup==4;
replace time=4 if agegroup==5;

quietly tab agegroup, gen(agegroup);

gen lgreg=0;
replace lgreg=1 if north==1;
replace lgreg=2 if norwest==1;
replace lgreg=3 if central==1;
replace lgreg=3 if regno==16;
replace lgreg=4 if cenchern==1;
replace lgreg=5 if volga==1;
replace lgreg=6 if povolzh==1;
replace lgreg=7 if ncauc==1;
replace lgreg=8 if urals==1;
replace lgreg=9 if esib==1;
replace lgreg=10 if wsib==1;
replace lgreg=11 if fareast==1;

gen lnpop=log(pop);
gen lnpopu=log(popu);
gen lnpopr=log(popr);
gen urbsh=(popmu+popfu)/(popm+popf) ;

*  Age 18-49;
*  Divorces per 1000 married population in each age group;
reg divr sr10a lnpop urbsh i.agegroup i.regno i.lgreg#i.agegroup, cluster(regno);
reg divru sr10u lnpopu i.agegroup i.regno i.lgreg#i.agegroup, cluster(regno);
reg divrr sr10r lnpopr i.agegroup i.regno i.lgreg#i.agegroup, cluster(regno);

log close;


